package com.acme.hashmap;

/**
 * Map int -> int
 *
 * @author Gregory Sobko
 */
public interface MapIntToInt {

    /**
     * puts pair key -> value to map. will replace previous entry
     *
     * @param key   key
     * @param value value
     * @return Returns value of element, previously corresponding key, null if there was no such element
     */
    Integer put(int key, int value);

    /**
     * gets value by key
     *
     * @param key key to lookup
     * @return value corresponding key, null if no such key exist
     */
    Integer get(int key);

    /**
     * Check if key is present
     *
     * @param key key to lookup
     * @return true if key is present, false otherwise
     */
    boolean contains(int key);

    /**
     * removes key-value pair from map
     *
     * @param key key to lookup
     * @return just removed value, null if key no present in map
     */
    Integer remove(int key);

    /**
     * Clears map. Should set size to 0
     */
    void clear();

    /**
     * returns size of map
     *
     * @return size
     */
    int size();

}
